function buscarContacto() {
	var nombreContacto = $("#buscador-contactos").val();
	var url = 'http://localhost:8080/contacto/app/contacto/' + nombreContacto;
	var resultado = $.getJSON(url, function(contacto) {
	
		$("#tablaDeContactos").find("tr:gt(0)").remove();
	
		$("#contactoRowTemplate").tmpl	(contacto).appendTo("#tablaDeContactos");
	
	});

}

function agregarContacto(){
	document.location.href= document.URL + "jsp/agregarContacto.jsp";
}

function returnToIndex(){
	document.location.href="index.jsp";
}

function guardar(data) {
	alumnoService_guardar(data, onSuccessSave, onCompleteSave, onErrorSave);
}

function alumnoService_guardar(data, onSuccessCallback, onCompleteCallback,
		onErrorCallback) {

	var url = "http://localhost:8080/contacto/app/contacto";

	jQuery.ajax({
		type : 'POST',
		url : url,
		async : true,
		contentType : 'application/json',
		data : JSON.stringify(data),
		dataType : 'json',
		success : onSuccessCallback,
		complete : onCompleteCallback,
		error : onErrorCallback

	});
}
